package com.androidx.p013lv.mine.model;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.androidx.p013lv.base.http.BaseRes;
import com.androidx.p013lv.base.http.HttpUtils;
import com.androidx.p013lv.base.http.UrlManager;
import com.androidx.p013lv.base.http.callback.HttpCallback;
import com.androidx.p013lv.mine.bean.BuyHistoryBean;

/* renamed from: com.androidx.lv.mine.model.BuyHistoryModel */
public class BuyHistoryModel extends ViewModel {
    private MutableLiveData<BaseRes<BuyHistoryBean>> liveData;

    public MutableLiveData<BaseRes<BuyHistoryBean>> data() {
        if (this.liveData == null) {
            this.liveData = new MutableLiveData<>();
        }
        return this.liveData;
    }

    public void getBuyHistory(int i) {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().purchaseRecord(i), new HttpCallback<BaseRes<BuyHistoryBean>>("purchaseRecord") {
            /* class com.androidx.p013lv.mine.model.BuyHistoryModel.C13421 */

            public void onLvSuccess(BaseRes<BuyHistoryBean> baseRes) {
                BuyHistoryModel.this.liveData.setValue(baseRes);
            }
        });
    }

    public void cancelHttp() {
        HttpUtils.getInsatance().cancelTag("purchaseRecord");
    }
}
